<div class="title">通过标签查询</div>
<% if Customer.untagged.any? %>
<div class="letter_and_tags grid_5 alpha untagged">
  <div class="letter grid_1 alpha omega">
    <b>&nbsp;</b>
  </div>
  <div class="grid_4">
  <%= link_to customers_url(:untagged => true), :title => '未带有标签的联系人' do %>
    未带标签(<b><%= Customer.untagged.size %></b>)
  <% end %>
  </div>
</div>
<% end %>
<% ('A'..'Z').each do |char| %>
  <% if Tag.start_with(char).any? %>
  <div class="letter_and_tags grid_5 alpha">
    <div class="letter grid_1 alpha omega">
      <b><%= char %></b>
    </div>
    <div class="related_tags grid_4 ">
      <% Tag.start_with(char).each do |tag| %>
        <%= link_to tag.name, customers_url(:tag_id => tag.id), :title => '点击浏览此标签的所有联系人资料', :class => "right_tag_#{tag.id}" %>
      <% end %>
    </div>
  </div>
  <% end %>
<% end %>